package org.givwenzen.editors;

import org.eclipse.jface.text.rules.*;

public class GWZPartitionScanner extends RuleBasedPartitionScanner {
	public final static String GWZ = "__gwz";
	public final static String GWZ_SCRIPT = "__gwz_script";

	public GWZPartitionScanner() {

		IToken gwz = new Token(GWZ);
		IToken gwz_script = new Token(GWZ_SCRIPT);

		IPredicateRule[] rules = new IPredicateRule[] {
    		new SingleLineRule("Given", ": ", gwz),
    		new SingleLineRule("When", ": ", gwz),
    		new SingleLineRule("Then", ": ", gwz),
    		new SingleLineRule("And", ": ", gwz),
    		new SingleLineRule("![: script", "", gwz_script),
    		new SingleLineRule("]!", "", gwz_script),
		};
		setPredicateRules(rules);
	}
}
